package com.xiaolin.admin.controller;

import com.xiaolin.admin.service.ExcelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * @author xiaolin
 * @description 描述
 * @since 2024/10/23
 */
@RestController
@RequestMapping("/excel")
public class ExcelController {
    @Autowired
    private ExcelService excelService;

    /**
     * 基本导出
     * @param response
     */
    @GetMapping("/lowExport")
    public void lowExport(HttpServletResponse response) {
        excelService.lowExport(response);
    }

    /**
     * 大数据导出
     * @param response
     */
    @GetMapping("/export")
    public void export(HttpServletResponse response) {
        excelService.export(response);
    }

    /**
     * 分批导出
     * @param response
     */
    @GetMapping("/stableExport")
    public void stableExport(HttpServletResponse response) {
        excelService.stableExport(response);
    }

    /**
     * 异步分批导出
     */
    @GetMapping("/asyncExport")
    public void asyncExport() {
        excelService.asyncExport();
    }
}
